<?php
//initialize the session
if (!isset($_SESSION)) {
  session_start();
}
include "txt/url.php";
require 'fblogin/src/config.php';
?>
<?php require_once('Connections/sepolwan_connect.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}


function curPageURL() { 

$pageURL = 'http'; 

if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} 

$pageURL .= "://"; 

if ($_SERVER["SERVER_PORT"] != "80") { 

  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; 

} else { 

  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; 

} 

return $pageURL; 

} 

$colname_sesi_member = "-1";
if (isset($_SESSION['MM_Username'])) {
  $colname_sesi_member = $_SESSION['MM_Username'];
}
mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
$query_sesi_member = sprintf("SELECT * FROM memberdb WHERE email = %s", GetSQLValueString($colname_sesi_member, "text"));
$sesi_member = mysql_query($query_sesi_member, $sepolwan_connect) or die(mysql_error());
$row_sesi_member = mysql_fetch_assoc($sesi_member);
$totalRows_sesi_member = mysql_num_rows($sesi_member);

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  //to fully log out a visitor we need to clear the session varialbles
  
  $updateSQL = sprintf("UPDATE memberdb SET notice=%s WHERE id=%s",
                       GetSQLValueString('OFFLINE', "text"),
                       GetSQLValueString($row_sesi_member['id'], "int"));

  mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
  $Result1 = mysql_query($updateSQL, $sepolwan_connect) or die(mysql_error());
  
  $_SESSION['MM_Username'] = NULL;
  $_SESSION['MM_UserGroup'] = NULL;
  $_SESSION['PrevUrl'] = NULL;
  unset($_SESSION['MM_Username']);
  unset($_SESSION['MM_UserGroup']);
  unset($_SESSION['PrevUrl']);
	
  $logoutGoTo = "index.php?stat=keluar";
  if ($logoutGoTo) {
    header("Location: $logoutGoTo");
    exit;
  }
}


if ($totalRows_sesi_member>0){
	mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
$query_ikut = "SELECT * FROM ikut WHERE dari = '".$row_sesi_member['id']."' and  ke = '".$row_sesi_member['id']."' ORDER BY id DESC";
$ikut = mysql_query($query_ikut, $sepolwan_connect) or die(mysql_error());
$row_ikut = mysql_fetch_assoc($ikut);
$totalRows_ikut = mysql_num_rows($ikut);
	if ($totalRows_ikut==0) {
	$insertSQL = sprintf("INSERT INTO ikut (id, dari, ke) VALUES (%s, %s, %s)",
                       GetSQLValueString("", "int"),
                       GetSQLValueString($row_sesi_member['id'], "int"),
					   GetSQLValueString($row_sesi_member['id'], "int"));

  mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
  $Result1 = mysql_query($insertSQL, $sepolwan_connect) or die(mysql_error());
	}
  mysql_free_result($ikut);
 $updateSQL = sprintf("UPDATE memberdb SET notice=%s WHERE id=%s",
                       GetSQLValueString('ONLINE', "text"),
                       GetSQLValueString($row_sesi_member['id'], "int"));

  mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
  $Result1 = mysql_query($updateSQL, $sepolwan_connect) or die(mysql_error());
}
  
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["okikut"])) && ($_POST["okikut"] == "Follow") && ($totalRows_sesi_member>0)) {
	
$colname_kut = "-1";
if (isset($row_sesi_member['id'])) {
  $colname_kut = $row_sesi_member['id'];
}
$colname_ke = "-1";
if (isset($_POST['ke'])) {
  $colname_ke = $_POST['ke'];
}
mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
$query_kut = sprintf("SELECT * FROM ikut WHERE dari = %s AND ke = %s", GetSQLValueString($colname_kut, "int"), GetSQLValueString($colname_ke, "int"));
$kut = mysql_query($query_kut, $sepolwan_connect) or die(mysql_error());
$row_kut = mysql_fetch_assoc($kut);
$totalRows_kut = mysql_num_rows($kut);
if ($totalRows_kut==0){
	$insertSQL = sprintf("INSERT INTO ikut (id, dari, ke) VALUES (%s, %s, %s)",
                       GetSQLValueString("", "int"),
                       GetSQLValueString($row_sesi_member['id'], "int"),
					   GetSQLValueString($_POST['ke'], "int"));

  mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
  $Result1 = mysql_query($insertSQL, $sepolwan_connect) or die(mysql_error());
  
}
  
  $updateGoTo = $_GET['user'];
  header(sprintf("Location: %s", $updateGoTo));
}
if ((isset($_POST["delikut"])) && ($_POST["delikut"] == "Following")) {
	$deleteSQL = sprintf("DELETE FROM ikut WHERE dari=%s AND ke=%s",
                       GetSQLValueString($row_sesi_member['id'], "int"),
					   GetSQLValueString($_POST['ke'], "int"));

  mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
  $Result1 = mysql_query($deleteSQL, $sepolwan_connect) or die(mysql_error());
  
  $updateGoTo = $_GET['user'];
  header(sprintf("Location: %s", $updateGoTo));
}


if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "editdatauser") && ($totalRows_sesi_member>0)) {
  $updateSQL = sprintf("UPDATE memberdb SET full_name=%s, foto_profile=%s, cover_profile=%s, about=%s, tempat=%s, website=%s WHERE id=%s",
                       GetSQLValueString(preg_replace("/[^a-z0-9\\040\\.\\-\\_\\\\]/i", "", $_POST['full_name']), "text"),
                       GetSQLValueString(md5($row_sesi_member['id']).".jpg", "text"),
                       GetSQLValueString(md5($row_sesi_member['id']).".jpg", "text"),
                       GetSQLValueString(preg_replace("/[^a-z0-9\\040\\.\\-\\_\\\\]/i", "", $_POST['about']), "text"),
                       GetSQLValueString(preg_replace("/[^a-z0-9\\040\\.\\-\\_\\\\]/i", "", $_POST['tempat']), "text"),
                       GetSQLValueString(preg_replace("/[^a-z0-9\\040\\.\\-\\_\\\\]/i", "", $_POST['website']), "text"),
                       GetSQLValueString($row_sesi_member['id'], "int"));
					   


  mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
  $Result1 = mysql_query($updateSQL, $sepolwan_connect) or die(mysql_error());
  
  

  $image=$_FILES['foto_profile']['name'];	   
define ("MAX_SIZE","400");
 function getExtension($str) {
         $i = strrpos($str,".");
         if (!$i) { return ""; }
         $l = strlen($str) - $i;
         $ext = substr($str,$i+1,$l);
         return $ext;
 }

 $errors=0;
  
 if($_SERVER["REQUEST_METHOD"] == "POST")
 {
 	$image=$image;
	$uploadedfile = $_FILES['foto_profile']['tmp_name'];
     
 
 	if ($image) 
 	{
 	
 		$filename = stripslashes($image);
 	
  		$extension = getExtension($filename);
 		$extension = strtolower($extension);
		
		
 if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) 
 		{
		
 			$change='<div class="msgdiv">Unknown Image extension </div> ';
 			$errors=1;
 		}
 		else
 		{

 $size=filesize($_FILES['foto_profile']['tmp_name']);


if ($size > MAX_SIZE*1024)
{
	$change='<div class="msgdiv">You have exceeded the size limit!</div> ';
	$errors=1;
}


if($extension=="jpg" || $extension=="jpeg" )
{
$uploadedfile = $_FILES['foto_profile']['tmp_name'];
$src = imagecreatefromjpeg($uploadedfile);

}
else if($extension=="png")
{
$uploadedfile = $_FILES['foto_profile']['tmp_name'];
$src = imagecreatefrompng($uploadedfile);

}
else 
{
$src = imagecreatefromgif($uploadedfile);
}

echo $scr;

list($width,$height)=getimagesize($uploadedfile);


$newwidth=500;
$newheight=($height/$width)*$newwidth;
$tmp=imagecreatetruecolor($newwidth,$newheight);

imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);

$filename = "images/member/ava/".md5($row_sesi_member['id']).".jpg";



imagejpeg($tmp,$filename,100);
imagedestroy($src);
imagedestroy($tmp);
}}

}

  


$image2=$_FILES['cover_profile']['name'];	
  
     
define ("MAX_SIZE","400");


 $errors2=0;
  
 if($_SERVER["REQUEST_METHOD"] == "POST")
 {
 	$image2=$image2;
	$uploadedfile2 = $_FILES['cover_profile']['tmp_name'];
     
 
 	if ($image2) 
 	{
 	
 		$filename2 = stripslashes($image2);
 	
  		$extension2 = getExtension($filename2);
 		$extension2 = strtolower($extension2);
		
		
 if (($extension2 != "jpg") && ($extension2 != "jpeg") && ($extension2 != "png") && ($extension2 != "gif")) 
 		{
		
 			$change2='<div class="msgdiv">Unknown Image extension </div> ';
 			$errors2=1;
 		}
 		else
 		{

 $size2=filesize($_FILES['cover_profile']['tmp_name']);


if ($size2 > MAX_SIZE*1024)
{
	$change2='<div class="msgdiv">You have exceeded the size limit!</div> ';
	$errors2=1;
}


if($extension2=="jpg" || $extension2=="jpeg" )
{
$uploadedfile2 = $_FILES['cover_profile']['tmp_name'];
$src2 = imagecreatefromjpeg($uploadedfile2);

}
else if($extension2=="png")
{
$uploadedfile2 = $_FILES['cover_profile']['tmp_name'];
$src2 = imagecreatefrompng($uploadedfile2);

}
else 
{
$src2 = imagecreatefromgif($uploadedfile2);
}

echo $scr2;

list($width2,$height2)=getimagesize($uploadedfile2);


$newwidth2=950;
$newheight2=($height2/$width2)*$newwidth2;
$tmp2=imagecreatetruecolor($newwidth2,$newheight2);

imagecopyresampled($tmp2,$src2,0,0,0,0,$newwidth2,$newheight2,$width2,$height2);


$filename2 = "images/member/cover/".md5($row_sesi_member['id']).".jpg";




imagejpeg($tmp2,$filename2,100);

imagedestroy($src2);
imagedestroy($tmp2);
}}

}
if(file_exists('images/member/ava/resize_120_120_'.md5($row_sesi_member['id']).".jpg"))
unlink('images/member/ava/resize_120_120_'.md5($row_sesi_member['id']).".jpg");
if(file_exists('images/member/ava/resize_22_22_'.md5($row_sesi_member['id']).".jpg"))
unlink('images/member/ava/resize_22_22_'.md5($row_sesi_member['id']).".jpg");
if(file_exists('images/member/ava/resize_50_50_'.md5($row_sesi_member['id']).".jpg"))
unlink('images/member/ava/resize_50_50_'.md5($row_sesi_member['id']).".jpg");
if(file_exists('images/member/ava/resize_30_30_'.md5($row_sesi_member['id']).".jpg"))
unlink('images/member/ava/resize_30_30_'.md5($row_sesi_member['id']).".jpg");
if(file_exists('images/member/ava/resize_230_230_'.md5($row_sesi_member['id']).".jpg"))
unlink('images/member/ava/resize_230_230_'.md5($row_sesi_member['id']).".jpg");
if(file_exists('images/member/cover/resize_950_310_'.md5($row_sesi_member['id']).".jpg"))
unlink('images/member/cover/resize_950_310_'.md5($row_sesi_member['id']).".jpg");

  header(sprintf("Location: %s", $deleteGoTo));
$updateGoTo = curPageURL();;
  header(sprintf("Location: %s", curPageURL()));
  
}





session_start();



if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "post_tl") && ($_POST["isi"] <> "") && ($totalRows_sesi_member>0)) {
  $insertSQL = sprintf("INSERT INTO dinding_tl (judul, isi, me, jenis, waktu) VALUES (%s, %s, %s, %s, %s)",
                       GetSQLValueString(str_replace(array('<', '>'), array('&lt;', '&gt;'), $_POST['judul']), "text"),
                       GetSQLValueString(str_replace(array('<', '>'), array('&lt;', '&gt;'), $_POST['isi']), "text"),
					   GetSQLValueString($row_sesi_member['id'], "int"),
					   GetSQLValueString('public', "text"),
					   GetSQLValueString(gmdate("Y-m-d H:i:s", time()+60*60*7), "text"));

  mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
  $Result1 = mysql_query($insertSQL, $sepolwan_connect) or die(mysql_error());
  
  $updateGoTo = curPageURL();
  header(sprintf("Location: %s", $updateGoTo));
}
 

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "daftarcoy") && ($_POST["full_name"] <> "") && ($_POST["nama_user"] <> "") && ($_POST["email"] <> "") && ($_POST["password"] <> "") && ($_POST["password"] == $_POST["passwordlg"]) && ($_POST['captcha'] == $_SESSION['captcha'])) {
  $insertSQL = sprintf("INSERT INTO memberdb (id, full_name, nama_user, email, password, aktif) VALUES (%s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['id'], "int"),
                       GetSQLValueString(preg_replace("/[^a-z0-9\\040\\.\\-\\_\\\\]/i", "", $_POST['full_name']), "text"),
                       GetSQLValueString(str_replace(' ', '-', preg_replace("/[^a-z0-9\\040\\.\\-\\_\\\\]/i", "", $_POST['nama_user'])), "text"),
                       GetSQLValueString($_POST['email'], "text"),
                       GetSQLValueString(md5($_POST['password']), "text"),
                       GetSQLValueString(md5($_POST['nama_user'].$_POST['password']), "text"));

  mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
  $Result1 = mysql_query($insertSQL, $sepolwan_connect) or die('Maaf, Terjadi Kesalahan Input Data.. <br /> silahkan coba lagi..');
  
 
  
  //KIRIM EMAIL BUNG//

$to = $_POST['email'];

$judul = "Aktifasi Akun www.".$_SERVER['HTTP_HOST']."";

$msg .= "<div align='center' style='padding:10px'>
<img src='http://geriloji.com/images/logo2.png' width='194' height='60' />
</div>
<div style='background:#006; width:100%; height:5px'></div>
<p>Terimakasih Sdr/i Telah Mengunjungi Situs Kami www.geriloji.com</p>
<p>Berikut data akun geriloji anda<br />
Username : ".$_POST['nama_user']."<br />
Email : ".$_POST['email']."<br />
Password : ".$_POST['password']."</p>
<p>Silahkan aktivasi akun anda dengan klik link berikut :<br />
http://geriloji.com/aktifasi.php?key=".md5($_POST['nama_user'].$_POST['password'])."</p>
<div style='background:#006; width:100%; height:5px'></div>
<div align='center' style='padding:10px'>
Copyright &copy; 2013, www.geriloji.com
</div>";

$hulu = 'MIME-Version: 1.0' . "\r\n";

$hulu .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";


$hulu .= "From: Info Geriloji Media <no-reply@".$_SERVER['HTTP_HOST'].">" . "\r\n" .
"Reply-To: cahya691@gmail.com" . "\r\n" ;

$get=mail($to, $judul, $msg, $hulu);


//KIRIM EMAIL BUNG//
 
}







session_start();



//KOMENTAR MEMBER//
if ($_SESSION['MM_Username']){
	if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "comentar_member") && ($_POST["komentar"] <> "") && ($_POST["komentar"] <> " ") && ($totalRows_sesi_member>0)) {
  $insertSQL = sprintf("INSERT INTO dinding_tl (id, form, me, jenis, isi, waktu) VALUES (%s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['id'], "int"),
                       GetSQLValueString($_GET['idart'], "text"),
                       GetSQLValueString($row_sesi_member['id'], "text"),
                       GetSQLValueString('komentar', "text"),
                       GetSQLValueString(str_replace(array('<', '>'), array('&lt;', '&gt;'), $_POST['komentar']), "text"),
					   GetSQLValueString(gmdate("Y-m-d H:i:s", time()+60*60*7), "text"));

  mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
  $Result1 = mysql_query($insertSQL, $sepolwan_connect) or die(mysql_error());
  if ($_POST['idfrom']<>$row_sesi_member['id']){
  $updateSQL = sprintf("UPDATE memberdb SET notice=%s WHERE id=%s",
                       
					   GetSQLValueString($_POST['notice'], "text"),
                       GetSQLValueString($_POST['idfrom'], "text"));
					   
   mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
  $Result1 = mysql_query($updateSQL, $sepolwan_connect) or die(mysql_error());
  
  
  }
  $updateGoTo = "?coment=succeess";
  header(sprintf("Location: %s", $updateGoTo));
}
}
//KOMENTAR MEMBER//



if ($_SESSION['MM_Username']<>'riswan'){
	
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1") && ($_POST["komentar"] <> "") && ($totalRows_sesi_member>0)) {
  $insertSQL = sprintf("INSERT INTO komentar (id, idartikel, nama, email, komentar, waktu) VALUES (%s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['id'], "int"),
                       GetSQLValueString(str_replace(array('<', '>'), array('&lt;', '&gt;'), $_POST['idartikel']), "text"),
                       GetSQLValueString(str_replace(array('<', '>'), array('&lt;', '&gt;'), $row_sesi_member['nama_user']), "text"),
                       GetSQLValueString(str_replace(array('<', '>'), array('&lt;', '&gt;'), $row_sesi_member['email']), "text"),
                       GetSQLValueString(str_replace(array('<', '>'), array('&lt;', '&gt;'), $_POST['komentar']), "text"),
					   GetSQLValueString(gmdate("Y-m-d H:i:s", time()+60*60*7), "text"));

  mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
  $Result1 = mysql_query($insertSQL, $sepolwan_connect) or die(mysql_error());
  
  $updateSQL = sprintf("UPDATE artikel SET comment=%s WHERE id=%s",
                       
					   GetSQLValueString($_POST['tcomment']+1, "text"),
                       GetSQLValueString($_GET['idberita'], "text"));
					   
   mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
  $Result1 = mysql_query($updateSQL, $sepolwan_connect) or die(mysql_error());
  
  $updateGoTo = "../detail-".$_GET['idberita']."/".$_GET['link'].".html?coment=succeess";
  header(sprintf("Location: %s", $updateGoTo));
}
}

mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
$query_tl_user = "SELECT * FROM dinding_tl WHERE id = '".$_GET['idart']."' ORDER BY id DESC";
$tl_user = mysql_query($query_tl_user, $sepolwan_connect) or die(mysql_error());
$row_tl_user = mysql_fetch_assoc($tl_user);
$totalRows_tl_user = mysql_num_rows($tl_user);

?>
<?php include "tambah/date.php" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="index, follow" />
<meta name="author" content="Riswan Dwi Cahya" />
<meta name="description" content="Connect with friends and the world around you on Geriloji. Geriloji membantu Anda terhubung dan berbagi dengan orang-orang dalam kehidupan Anda." />
  <meta name="keywords" content="Connect with friends and the world around you on Geriloji. Geriloji membantu Anda terhubung dan berbagi dengan orang-orang dalam kehidupan Anda." />
  <meta name="title" content="<?php  if ($_GET['page']<>'member') { 
  if ($_GET['page']<>'detailberita' and $_GET['page']<>artikel) { 
  		echo str_replace(array('-', '/', '.html'), array(' ', ' | ', ' '), $_GET['page']); 
  } else if ($_GET['page']==detailberita) { 
 		 echo str_replace(array('-', '/', '.html'), array(' ', ' | ', ' '), $_GET['link']); 
  } else if ($_GET['page']==artikel) { 
  		 echo str_replace(array('-', '/', '.html'), array(' ', ' | ', ' '), $_GET['sub']);
  } if ($_GET['page']<>''){ echo " | "; }?> Geriloji Media <?php } else if ($_GET['page']=='member') { 
  $colname_tampil_member = "-1";
if (isset($_GET['user'])) {
  $colname_tampil_member = $_GET['user'];
}
mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
$query_tampil_member = sprintf("SELECT * FROM memberdb WHERE nama_user = %s", GetSQLValueString($colname_tampil_member, "text"));
$tampil_member = mysql_query($query_tampil_member, $sepolwan_connect) or die(mysql_error());
$row_tampil_member = mysql_fetch_assoc($tampil_member);
$totalRows_tampil_member = mysql_num_rows($tampil_member);
  
  echo $row_tl_user['judul'];
  echo " ".$row_tampil_member['full_name']." ";
  
  }?> " />
  
  
<title>
<?php if ($_GET['page']<>'member') {   if ($_GET['page']<>'detailberita' and $_GET['page']<>artikel) {   		echo str_replace(array('-', '/', '.html'), array(' ', ' | ', ' '), $_GET['page']);   } else if ($_GET['page']==detailberita) {  		 echo str_replace(array('-', '/', '.html'), array(' ', ' | ', ' '), $_GET['link']);   } else if ($_GET['page']==artikel) {   		 echo str_replace(array('-', '/', '.html'), array(' ', ' | ', ' '), $_GET['sub']);  } if ($_GET['page']<>''){ echo " | "; }?>
Geriloji Media
<?php } else if ($_GET['page']=='member') {       echo $row_tl_user['judul'];  echo " ".$row_tampil_member['full_name']." ";      mysql_free_result($tampil_member);  }  mysql_free_result($tl_user);  ?>
</title>
<link href='<?php echo $base ?>images/log.png' rel='shortcut icon'/>
<link href="<?php echo $base ?>gaya/style.css" rel="stylesheet" type="text/css" />

<?php if ($_GET['page']=='blog') { ?>
<link rel="stylesheet" type="text/css" href="<?php echo $base ?>ajax/css/style.css" />
<script type="text/javascript" src="<?php echo $base ?>ajax/js/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
function loadData(pageLimit){
     $(".flash").show();
     $(".flash").fadeIn(400).html
            ('Loading <img src="images/ajax-loading.gif" />');
     var dataString = 'pageLimit='+ pageLimit;
     $.ajax({
             type: "POST",
             url: "<?php echo $base ?>/ajax/blog.php",
            data: dataString,
            cache: false,
            success: function(result){ 
            $(".flash").hide();
            $(".load_more_link").addClass('noneLink');
            $("#pageData").append(result);
      }
  });
}
  loadData('0');
</script>
<?php } ?>
<?php if ($_GET['page']=='artikel') { ?>
<link rel="stylesheet" type="text/css" href="<?php echo $base ?>ajax/css/style.css" />
<script type="text/javascript" src="<?php echo $base ?>ajax/js/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
function loadData(pageLimit){
     $(".flash").show();
     $(".flash").fadeIn(400).html
            ('Loading <img src="images/ajax-loading.gif" />');
     var dataString = 'pageLimit='+ pageLimit;
     $.ajax({
             type: "POST",
             url: "<?php echo $base ?>pageload/<?php echo $_GET['sub'] ?>.html",
            data: dataString,
            cache: false,
            success: function(result){ 
            $(".flash").hide();
            $(".load_more_link").addClass('noneLink');
            $("#pageData").append(result);
      }
  });
}
  loadData('0');
</script>
<?php } ?>

<?php if ($_GET['page']=='people') { ?>
<link rel="stylesheet" type="text/css" href="<?php echo $base ?>ajax/css/style.css" />
<script type="text/javascript" src="<?php echo $base ?>ajax/js/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
function loadData(pageLimit){
     $(".flash").show();
     $(".flash").fadeIn(400).html
            ('Loading <img src="images/ajax-loading.gif" />');
     var dataString = 'pageLimit='+ pageLimit;
     $.ajax({
             type: "POST",
             url: "<?php echo $base ?>ajax/people.php",
            data: dataString,
            cache: false,
            success: function(result){ 
            $(".flash").hide();
            $(".load_more_link").addClass('noneLink');
            $("#pageData").append(result);
      }
  });
}
  loadData('0');
</script>
<?php } ?>
<?php if ($_GET['page']=='') { ?>
<link rel="stylesheet" type="text/css" href="<?php echo $base ?>ajax/css/style.css" />
<script type="text/javascript" src="<?php echo $base ?>ajax/js/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
function loadData(pageLimit){
     $(".flash").show();
     $(".flash").fadeIn(400).html
            ('Loading <img src="images/ajax-loading.gif" />');
     var dataString = 'pageLimit='+ pageLimit;
     $.ajax({
             type: "POST",
             url: "<?php echo $base ?>ajax/myfollowing.php",
            data: dataString,
            cache: false,
            success: function(result){ 
            $(".flash").hide();
            $(".load_more_link").addClass('noneLink');
            $("#pageData").append(result);
      }
  });
}
  loadData('0');
</script>
<?php } ?>
<?php if ($_GET['page']=='mention') { ?>
<link rel="stylesheet" type="text/css" href="<?php echo $base ?>ajax/css/style.css" />
<script type="text/javascript" src="<?php echo $base ?>ajax/js/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
function loadData(pageLimit){
     $(".flash").show();
     $(".flash").fadeIn(400).html
            ('Loading <img src="images/ajax-loading.gif" />');
     var dataString = 'pageLimit='+ pageLimit;
     $.ajax({
             type: "POST",
             url: "<?php echo $base ?>ajax/mentionme.php",
            data: dataString,
            cache: false,
            success: function(result){ 
            $(".flash").hide();
            $(".load_more_link").addClass('noneLink');
            $("#pageData").append(result);
      }
  });
}
  loadData('0');
</script>
<?php } ?>
<?php if ($_GET['page']=='member' and $_GET['subna']=='timeline') { ?>
<link rel="stylesheet" type="text/css" href="<?php echo $base ?>ajax/css/style.css" />
<script type="text/javascript" src="<?php echo $base ?>ajax/js/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
function loadData(pageLimit){
     $(".flash").show();
     $(".flash").fadeIn(400).html
            ('Loading <img src="images/ajax-loading.gif" />');
     var dataString = 'pageLimit='+ pageLimit;
     $.ajax({
             type: "POST",
             url: "<?php echo $base ?>loaddata/<?php echo $_GET['user'] ?>.html",
            data: dataString,
            cache: false,
            success: function(result){ 
            $(".flash").hide();
            $(".load_more_link").addClass('noneLink');
            $("#pageData").append(result);
      }
  });
}
  loadData('0');
</script>
<?php } ?>
<?php if ($_GET['page']=='member' and $_GET['subpp']=='following') { ?>
<link rel="stylesheet" type="text/css" href="<?php echo $base ?>ajax/css/style.css" />
<script type="text/javascript" src="<?php echo $base ?>ajax/js/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
function loadData(pageLimit){
     $(".flash").show();
     $(".flash").fadeIn(400).html
            ('Loading <img src="images/ajax-loading.gif" />');
     var dataString = 'pageLimit='+ pageLimit;
     $.ajax({
             type: "POST",
             url: "<?php echo $base ?>following/<?php echo $_GET['user'] ?>.html",
            data: dataString,
            cache: false,
            success: function(result){ 
            $(".flash").hide();
            $(".load_more_link").addClass('noneLink');
            $("#pageData").append(result);
      }
  });
}
  loadData('0');
</script>
<?php } ?>
<?php if ($_GET['page']=='member' and $_GET['subpp']=='followers') { ?>
<link rel="stylesheet" type="text/css" href="<?php echo $base ?>ajax/css/style.css" />
<script type="text/javascript" src="<?php echo $base ?>ajax/js/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
function loadData(pageLimit){
     $(".flash").show();
     $(".flash").fadeIn(400).html
            ('Loading <img src="images/ajax-loading.gif" />');
     var dataString = 'pageLimit='+ pageLimit;
     $.ajax({
             type: "POST",
             url: "<?php echo $base ?>followers/<?php echo $_GET['user'] ?>.html",
            data: dataString,
            cache: false,
            success: function(result){ 
            $(".flash").hide();
            $(".load_more_link").addClass('noneLink');
            $("#pageData").append(result);
      }
  });
}
  loadData('0');
</script>
<?php } ?>
<?php if ($_GET['page']=='member' and $_GET['subpp']=='tlfollowers') { ?>
<link rel="stylesheet" type="text/css" href="<?php echo $base ?>ajax/css/style.css" />
<script type="text/javascript" src="<?php echo $base ?>ajax/js/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
function loadData(pageLimit){
     $(".flash").show();
     $(".flash").fadeIn(400).html
            ('Loading <img src="images/ajax-loading.gif" />');
     var dataString = 'pageLimit='+ pageLimit;
     $.ajax({
             type: "POST",
             url: "<?php echo $base ?>tlfol/<?php echo $_GET['user'] ?>.html",
            data: dataString,
            cache: false,
            success: function(result){ 
            $(".flash").hide();
            $(".load_more_link").addClass('noneLink');
            $("#pageData").append(result);
      }
  });
}
  loadData('0');
</script>
<?php } ?>
<script type="text/javascript">

function popup(){
  cuteLittleWindow = window.open("<?php echo $base.'pesan/'; ?>", "littleWindow", "location=no,width=300,height=600,resize=no"); 
}
<?php if ($_GET['user']<>NULL) { ?>
function kirimpesan(){
  cuteLittleWindow = window.open("<?php echo $base.'pesan/'.$_GET['user'].'.html'; ?>", "littleWindow", "location=no,width=300,height=600,resize=no"); 
}
<?php } ?>
</script>
<script type="text/javascript" src="<?php echo $base ?>ajax/js/jquery-1.4.1.min.js"></script>
<script language="javascript" src="<?php echo $base ?>jquery-1.2.6.min.js"></script>
<script language="javascript" src="<?php echo $base ?>jquery.timers-1.0.0.js"></script>
<script type="text/javascript">

$(document).ready(function(){
   var j = jQuery.noConflict();
	j(document).ready(function()
	{
		j(".refresh").everyTime(1000,function(i){
			j.ajax({
			  url: "<?php echo $base ?>refresh.php",
			  cache: false,
			  success: function(html){
				j(".refresh").html(html);
			  }
			})
		})
		
	});
	 j('.refresh').css({color:"green"});
});
$(".refresh").scrollTop($(".refresh")[0].scrollHeight);
</script>
</head>

<body>

<div id="atas2">

  <table width="950" height="50" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="152" align="left"><a href="<?php echo $base ?>"><img src="<?php echo $base ?>images/logo2.png" width="120" /></a></td>
      <td width="700" align="left"><table width="100%" height="37" border="0" align="right" cellpadding="0" cellspacing="0">
        <tr>
        	<td align="right" valign="top"><form id="form1" name="form1" method="get" action="<?php echo $base ?>mencari.php">
            <input type="text" name="cari" id="search" placeholder="Search..." />
            </form></td>
          <td><table border="0" align="right" cellpadding="0" cellspacing="0">
            <tr>
              <td align="right"><?php if (!$_SESSION['MM_Username']) { ?>
                <a href="<?php echo $base ?>login.php">Login</a> | <a href="<?php echo $base ?>halaman/register.html">Register</a>
                <?php } else { 
				
mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
$query_folowing = "SELECT * FROM ikut WHERE dari = '".$row_sesi_member['id']."'";
$folowing = mysql_query($query_folowing, $sepolwan_connect) or die(mysql_error());
$row_folowing = mysql_fetch_assoc($folowing);
$totalRows_folowing = mysql_num_rows($folowing);

mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
$query_folowers = "SELECT * FROM ikut WHERE ke = '".$row_sesi_member['id']."'";
$folowers = mysql_query($query_folowers, $sepolwan_connect) or die(mysql_error());
$row_folowers = mysql_fetch_assoc($folowers);
$totalRows_folowers = mysql_num_rows($folowers);
				
				 ?>
                <ul class="menu">
                <li> <a href="<?php echo $base ?>"><img src="<?php echo $base ?>images/home.png" width="27" style="float:left" /> Home</a> </li>
                <li> <a href="<?php echo $base ?>halaman/mention.html"><img src="<?php echo $base ?>images/mantion.png" width="27" style="float:left" />Mentions</a> </li>
                <li><a href="<?php echo $base ?><?php echo $row_sesi_member['nama_user']; ?>"><img src="<?php if(file_exists("images/member/ava/resize_22_22_".md5($row_sesi_member['id']).".jpg")) { echo $base."images/member/ava/resize_22_22_".md5($row_sesi_member['id']).".jpg"; } else {   if(file_exists("images/member/ava/".md5($row_sesi_member['id']).".jpg")) { echo $base."images/member/ava/tester_22_22_".md5($row_sesi_member['id']).".jpg"; } else { echo $base."images/member/ava/resize_22_22_default.jpg"; } } ?>" style="margin-right:3px" /> <img src="<?php echo $base ?>images/arh.JPG" width="10" height="35" /></a> 
                  <ul>
                  <li> <a href="<?php echo $base.$row_sesi_member['nama_user'] ?>/following">Following(<?php mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
$query_ceking = "SELECT * FROM ikut WHERE dari = $row_sesi_member[id] and ke = $row_sesi_member[id] ";
$ceking = mysql_query($query_ceking, $sepolwan_connect) or die(mysql_error());
$row_ceking = mysql_fetch_assoc($ceking);
$totalRows_ceking = mysql_num_rows($ceking);

if ($totalRows_ceking >0) { echo $totalRows_folowing-1; }  else { echo $totalRows_folowing; } 
mysql_free_result($ceking); ?>)</a> </li>
                  <li> <a href="<?php echo $base.$row_sesi_member['nama_user'] ?>/followers">Followers(<?php mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
$query_ceking = "SELECT * FROM ikut WHERE dari = $row_sesi_member[id] and ke = $row_sesi_member[id] ";
$ceking = mysql_query($query_ceking, $sepolwan_connect) or die(mysql_error());
$row_ceking = mysql_fetch_assoc($ceking);
$totalRows_ceking = mysql_num_rows($ceking);

if ($totalRows_ceking >0) { echo $totalRows_folowers-1; }  else { echo $totalRows_folowers; } 
mysql_free_result($ceking); ?>)</a> </li>
                  
                  <li> <a href="<?php echo $base.$row_sesi_member['nama_user'] ?>/edit">Edit Acount</a> </li>
                  <li><a href="<?php echo $logoutAction ?>">Logout</a></li></ul>
                  </li>
                  </ul>
                <?php 
mysql_free_result($folowing);
mysql_free_result($folowers); } ?></td>
            </tr>
          </table></td>
          
          </tr>
      </table></td>
    </tr>
  </table>
</div>
<div id="hotnews"></div>
<div style="width:100%; height:50px"></div>
<?php if ($_SESSION['MM_Username'] and $row_sesi_member['aktif']<>'ya') { ?><div style="width:100%; padding:5px; background:#F00; color:#FFF " align="center"><strong>Cek Email Anda Untuk Melakukan Aktifasi Akun</strong></div><?php } ?>
<?php if ($_GET['page']=='' and $_SESSION['MM_Username']==NULL){ ?><div id="banner" align="center">
  <table width="950" height="300" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="576"><h2>Connect with friends and the 
        world <br />
        around you on Geriloji.</h2>
Geriloji membantu Anda terhubung dan berbagi dengan orang-orang dalam kehidupan Anda.</td>
<td width="114">&nbsp;</td>
      <td width="260"><h2>Form Login</h2>
        <form id="form1" name="form1" method="POST" action="login.php">
      <label for="username"></label>
      <input name="username" type="text" id="username" placeholder="Email .. "  style="margin-bottom:15px; width:245px" />
      <label for="password"></label>
      <input name="password" type="password" id="password" placeholder="Password .. " style="margin-bottom:15px; width:245px" />
      <input type="submit" name="submit" id="submit" value="Sign In" style="width:260px; font-weight:bold; height:40px" />
    </form>
        <br />
      <font size="-2">don't have acount ?<a href="halaman/register.html" style="color:#FFF"> Register Now</a></font> <br /><br />
<div align="center"><?php echo $content = '<a href="https://www.facebook.com/dialog/oauth?client_id='.$config['App_ID'].'&redirect_uri='.$config['callback_url'].'&scope=email,user_likes,publish_stream"><img src="fblogin/images/login-button.png" alt="Sign in with Facebook"/></a>'; ?></div></td>
    </tr>
  </table>
</div>
<div style="position:fixed; bottom:0; width:100%"><?php include "tambah/copy.php"; ?></div>
<?php } ?>

<?php include "tambah/post.php"; ?>
<?php include "tambah/chat.php"; ?>
<?php if ($_GET['page']=='member') { include "tambah/profile.php"; } ?>

<?php include "tambah/get_page.php" ?>


</body>
</html>
<?php
mysql_free_result($sesi_member);
?>
